import { stringify } from 'qs';
import request from '@/utils/request';

//-- 获取未绑定的机器串码
export async function loadUnbindList(params) {
  return request(`/api/point/unbind-list`, {
    method: 'GET',
  });
}

//-- 分页查询
export async function list(params) {
  return request(`/api/point/list?${stringify(params)}`, {
    method: 'POST',
  });
}

//-- 楼盘列表
export async function getHouseByPointEdit(params) {
  return request(`/api/hourse/getHouseByPointEdit`, {
    method: 'POST',
    body: params,
  });
}

//-- 编辑电梯
export async function saveElevator(params) {
  return request(`/api/elevator/sys/save`, {
    method: 'POST',
    body: params,
  });
}

//-- 电梯列表
export async function getElevatorList(params) {
  return request(`/api/elevator/list`, {
    method: 'GET',
  });
}

//-- 编辑点位
export async function savePoint(params) {
  return request(`/api/point/sys/save`, {
    method: 'POST',
    body: params,
  });
}

//-- 员工列表
export async function getEmployeeList(params) {
  return request(`/api/employee/listAll`, {
    method: 'POST',
    body: params,
  });
}

//-- 根据ID获取点位信息
export async function getPointById(params) {
  return request(`/api/point/${params.id}`, {
    method: 'POST',
  });
}

// 状态控制
export async function enabledControl(params) {
  return request(`/api/point/enabledControl?${stringify(params)}`, {
    method: 'POST',
  });
}

//-- 显示该点位已上刊期刊
export async function showJournalListByPointId(params) {
    return request(`/api/jopoint/showJournalList/${params.pointId}`, {
        method: 'POST',
    });
}

//-- 重启点位
export async function pointReboot(params) {
    return request(`/api/point/pointReboot/${params.id}`, {
        method: 'POST',
    });
}

//-- 下载点位日志
export async function downloadDeviceLog(params) {
    return request(`/api/point/downloadDeviceLog${params.bType}/${params.id}`, {
        method: 'POST',
        body: params
    });
}
